<?php 

trait A
{
    public function demo()
    {
        echo 'A中的demo<br>';
    }
}
trait B
{
    public function demo()
    {
        echo 'B中的demo<br>';
    }
}
trait C
{
    public function demo()
    {
        echo 'C中的demo<br>';
    }
}

class U
{
    use A,B,C {
        A::demo insteadof B;
        A::demo insteadof C;

        B::demo as demob;
        C::demo as democ;
    }
}

$u = new U();
$u->demo();
$u->demob();
$u->democ();




